//
//  LoadWebVC.m
//  OCRunnerIntegradeDemo
//
//  Created by yryc on 2025/2/17.
//
#import "LoadWebVC.h"
#import <WebKit/WebKit.h>

@interface LoadWebVC () <WKUIDelegate>

@property (nonatomic, strong) WKWebView *webView;

@end

@implementation LoadWebVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // 创建 WKWebView 配置
    WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
    // 创建 WKWebView 实例
    self.webView = [[WKWebView alloc] initWithFrame:self.view.bounds configuration:configuration];
    self.webView.UIDelegate = self;
    // 将 WKWebView 添加到当前视图
    [self.view addSubview:self.webView];

    // 创建要加载的 URL
    NSURL *url = [NSURL URLWithString:@"https://www.baidu.com/s?wd=%E6%8E%98%E9%87%91+OCRunner%E9%9B%86%E6%88%90&tn=84053098_3_dg&ie=utf-8"];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    // 加载请求
    [self.webView loadRequest:request];
}

@end
